let express = require('express');
let router = express.Router();
let mongoose = require('mongoose');
let Citys = require('../models/swipe');

// let url = 'mongodb://127.0.0.1:27017/citys'
// //连接数据库
// mongoose.connect(url);

// mongoose.connection.on('connected', () => {
//  console.log("MongoDB connected success")
// });

// mongoose.connection.on('error', () => {
//   console.log("MongoDB connected fail")
//  });

//  mongoose.connection.on('disconnected', () => {
//   console.log("MongoDB connected disconnected")
//  });



//  router.get("/", (req, res, next) => {
//    Citys.find({}, (err, doc) => {
//       if(err){
//         res.json({
//           status: '1',
//           msg: err.message
//         });
//         res.json({
//           status: '0',
//           msg: '',
//           data:{
//             "hotCities": doc
//           }
//         })
//       }
//    })
//  })

 module.exports = router;